/*
 * Copyright (c) 2011 Jean-Marc Perronne
 * Ensisa, 12 rue des Freres Lumieres, F-68093 Mulhouse cedex
 * All rights reserved.
 *
 * The copyright of this software is owned by Werner Randelshofer. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Jean-Marc Perronne. For details see accompanying license terms. 
 */

package fr.uha.ensisa.jmp.drone.at_commands;


public class AtCtlCommand extends AbstractAtCommand
{	
	public final static int NO_CONTROL_MODE = 0;          		// Doing nothing
	public final static int ARDRONE_UPDATE_CONTROL_MODE = 1;  	// Ardrone software update reception (update is done next run)
		                                						// After event completion, card should power off
	public final static int PIC_UPDATE_CONTROL_MODE = 2;      	// Ardrone pic software update reception (update is done next run)
																// After event completion, card should power off
	public final static int LOGS_GET_CONTROL_MODE = 3;        	// Send previous run's logs
	public final static int CFG_GET_CONTROL_MODE = 4;         	// Send activ configuration
	public final static int ACK_CONTROL_MODE = 5;              	// Reset command mask in navdata

	private int toDo;
	private int fileSize;

	public AtCtlCommand()
	{
		super("CTRL");
		this.toDo = 0;
		this.fileSize = 0;
	}
	
	public void param(int toDo, int fileSize)
	{
		this.unReady();
		this.toDo = toDo;
		this.fileSize = fileSize;
	}

	public int toDo()
	{
		return this.toDo;
	}
	
	public int fileSize()
	{
		return this.fileSize;
	}

	@Override
	protected void appendParamaters(StringBuilder builder)
	{
		builder.append(',').append(this.toDo);
		builder.append(',').append(this.fileSize);
	}
}
